<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="huoyun" uri="/huoyun"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>注册新的车辆</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/theme/css/main.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/theme/css/style_userCenter.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/dialog.css">
<style type="text/css">
.registerCar td input.text{
	width: 120px;
}
</style>

<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/calendar/WdatePicker.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/jquery.validate.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/additional-methods.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/jquery.form.js"></script>
	<!--
<script type="text/javascript" src="${pageContext.request.contextPath}/car/js/register-car-tzh.js"></script>
  -->
<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/dialog.js"></script>

<script type="text/javascript">
	  $(document).ready(function(){
	  	$("#regCarForm").validate({
	  	errorPlacement: function(error, element) {
			// element.parent("td").append(error);
				element.attr("title", error.html());
			},
	  	rules : {
	  		"car.driverId" : {
	  			required : true,
	  			isValid : true
	  		},
	  		"car.type":{
	  			required : true,
	  			isValid : true
	  		},
	  		"car.loadMax":{
	  			required : true,
	  			number: true
	  		},
	  		"car.length":{
	  			required : true,
	  			number: true
	  		},
	  		"car.width":{
	  			required : true,
	  			number: true
	  		},
	  		"car.height":{
	  			required : true,
	  			number: true
	  		},
	  		"cardNumber1":{
	  			required : true
	  		},
	  		"cardNumber2":{
	  			required : true
	  		},
	  		"cardNumber3":{
	  			required : true,
	  			carNumber5 : true
	  		},
	  		"car.engineNumber":{
	  			required : true
	  		},
	  		"car.carIDCode":{
	  			required : true
	  		},
	  		"car.owner":{
	  			required : true
	  		},
	  		"car.registrationDate":{
	  			date1: true
	  		},
	  		"car.issueDate":{
	  			date1: true
	  		}
	  	},
	  	messages : {
	  		"car.driverId" : {
	  			required : "请选择司机",
	  			isValid : "请选择司机"
	  		},
	  		"car.type":{
	  			required : "请选择车辆类型信息",
	  			isValid : "请选择车辆类型信息"
	  		},
	  		"car.loadMax":{
	  			required : "请输入额定载重量",
	  			number: "请输入合法的数字"
	  		},
	  		"car.length":{
	  			required : "请输入车辆的长度",
	  			number: "请输入合法的长度数值"
	  		},
	  		"car.width":{
	  			required : "请输入车辆的宽度",
	  			number: "请输入合法的宽度数值"
	  		},
	  		"car.height":{
	  			required : "请输入车辆的高度",
	  			number: "请输入合法的高度数值"
	  		},
	  		"cardNumber1":{
	  			required : "请选择车牌号所属区域"
	  		},
	  		"cardNumber2":{
	  			required : "请选择车牌号所属区域"
	  		},
	  		"cardNumber3":{
	  			required : "请输入车牌号",
	  			carNumber5 : "请填写正确的车牌号"
	  		},
	  		"car.engineNumber":{
	  			required : "请输入发动机号码"
	  		},
	  		"car.carIDCode":{
	  			required : "请输入车辆识别代号"
	  		},
	  		"car.owner":{
	  			required : "请输入车辆归属人"
	  		},
	  		"car.registrationDate":{
	  			date1: "请输入合法的注册日期"
	  		},
	  		"car.issueDate":{
	  			date1: "请输入合法的发证日期"
	  		}
	  	}
	  	});
	  });
  </script>
 
</head>

<body>
	<div>
		<jsp:include page="../userAdmin/nav.jsp">
			<jsp:param value="nav_main" name="nav" />
		</jsp:include>
	</div>
	<div class="realCer">
		<!--主体部分-->
		<div class="realMain clearfix mt10">
			<!--左侧菜单-->
			<div class="realLeft" id="meunLeft">
				<jsp:include page="../userAdmin/leftMenu.jsp">
					<jsp:param value="con_nav_main" name="con_nav" />
					<jsp:param value="registerCar" name="selectMenu"/>
				</jsp:include>
			</div>
			<!--中间-->
			<div class="realRight ml10">
				<!--中间-->
				<div class="realR_left">
					<div class="box" style="width:805px;">
						<div class="tit">
							<strong>注册新的车辆</strong>
						</div>
						<div class="con">
							<div style="color: red; margin-left: 100px;">
								<s:property value="resultMsg" />
								<s:fielderror></s:fielderror>
							</div>
							<div class="form_wrap clearfix">
								<form style="position:relative; left:50px;" method="post" id="regCarForm" name="regCarForm" action="/huoyun/car/saveAll.action">
									<strong><font size="4px"><span
											class="required-field">注意：</span>加<span class="required-field">*</span>号项为必填项！</font>
									</strong> <br>
									<br>

									<!-- 车辆基本信息 -->
									<div class="form_wrap clearfix">
										<table class="tableForm registerCar">
										<tbody>
											<tr>
												<td colspan="2" >
													<h2>司机信息</h2>
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>司机：
												</td>
												<td class="tdValue">
													<s:select id="driver_select" name="car.driverId"
														list="driverList" listKey="id" listValue="name"
														headerKey="-1" headerValue="请选择" emptyOption="false"
														multiple="false" theme="simple">
													</s:select>
													<a class="add" href="javascript:;" onclick="openDialog();">添加司机</a>
												</td>
											</tr>
											<tr>
												<td colspan="2" >
													<h2>车辆基本信息</h2>
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="120">
													<span class="required-field">*</span>车辆类型：
												</td>
												<td class="tdValue">
													<huoyun:customSelect mode="carRequiredType" name="car.type" id="car.type"/>
													<%-- <select name="car.type" id="car.type" class="car.type">
													<option value="普通车辆">普通车辆</option>
													<option value="平板车辆">平板车辆</option>
													<option value="冷藏车辆">冷藏车辆</option>
													<option value="半挂车辆">半挂车辆</option>
													<option value="前四后八">前四后八</option>
													<option value="集装箱车">集装箱车</option>
													<option value="箱式车辆">箱式车辆</option>
													<option value="半封车辆">半封车辆</option>
													<option value="保温车辆">保温车辆</option>
													<option value="双桥车辆">双桥车辆</option>
													<option value="单桥车辆">单桥车辆</option>
													<option value="高栏车辆">高栏车辆</option>
													<option value="低栏车辆">低栏车辆</option>
													<option value="棚车">棚车</option>
													<option value="其他车辆">其他车辆</option>
												</select> --%>
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>额定载重量：
												</td>
												<td class="tdValue">
													<input type="text" name="car.loadMax" id="car.loadMax" style="width:60px;" class="inputtext" />&nbsp;吨
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>车厢规格：
												</td>
												<td class="tdValue">
													<input type="text" name="car.length" id="car.length"
														class="inputtext" style="WIDTH:60px" />
													<label for="car.length">长(m)×</label>
													<input type="text" name="car.width" id="car.width"
														class="inputtext" style="WIDTH:60px" />
													<label for="car.width">宽(m)×</label>
													<input type="text" name="car.height" id="car.height"
														class="inputtext" style="WIDTH:60px" />
													<label for="car.height">高(m)</label>
												</td>
											</tr>
											<tr>
												<td colspan="2" >
													<h2>车辆行驶证信息</h2>
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>车牌号：
												</td>
												<td class="tdValue">
													<!-- <input type="text" name="car.cardNumber" id="cardNumber"
													class="inputtext"/> -->
													<select name="cardNumber1" id="cardNumber1" style="width:50px;">
														<option value="京">京</option>
														<option value="津">津</option>
														<option value="渝">渝</option>
														<option value="沪">沪</option>
														<option value="冀">冀</option>
														<option value="豫">豫</option>
														<option value="云">云</option>
														<option value="辽">辽</option>
														<option value="黑">黑</option>
														<option value="湘">湘</option>
														<option value="皖">皖</option>
														<option value="鲁">鲁</option>
														<option value="新">新</option>
														<option value="苏">苏</option>
														<option value="浙">浙</option>
														<option value="赣">赣</option>
														<option value="鄂">鄂</option>
														<option value="桂">桂</option>
														<option value="甘">甘</option>
														<option value="晋">晋</option>
														<option value="蒙">蒙</option>
														<option value="陕">陕</option>
														<option value="吉">吉</option>
														<option value="闽">闽</option>
														<option value="贵">贵</option>
														<option value="粤">粤</option>
														<option value="川">川</option>
														<option value="青">青</option>
														<option value="藏">藏</option>
														<option value="宁">宁</option>
														<option value="琼">琼</option>
													</select>
													<select name="cardNumber2" id="cardNumber2" style="width:45px;">
														<option value="A">A</option>
														<option value="B">B</option>
														<option value="C">C</option>
														<option value="D">D</option>
														<option value="E">E</option>
														<option value="F">F</option>
														<option value="G">G</option>
														<option value="H">H</option>
														<option value="I">I</option>
														<option value="J">J</option>
														<option value="K">K</option>
														<option value="L">L</option>
														<option value="M">M</option>
														<option value="N">N</option>
														<option value="O">O</option>
														<option value="P">P</option>
														<option value="Q">Q</option>
														<option value="R">R</option>
														<option value="S">S</option>
														<option value="T">T</option>
														<option value="U">U</option>
														<option value="V">V</option>
														<option value="W">W</option>
														<option value="X">X</option>
														<option value="Y">Y</option>
														<option value="Z">Z</option>
													</select>
													<input type="text" maxlength="5" name="cardNumber3" id="cardNumber3" style="width:60px;text-transform:uppercase">
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>发动机号码：
												</td>
												<td class="tdValue">
													<input type="text" name="car.engineNumber"
													id="car.engineNumber" class="inputtext" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>车辆识别代号：
												</td>
												<td class="tdValue">
													<input type="text" name="car.carIDCode" id="car.carIDCode"
													class="inputtext" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													车辆品牌：
												</td>
												<td class="tdValue">
													<input type="text" name="car.brand" id="car.brand"
													class="inputtext" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													车辆行驶证地址：
												</td>
												<td class="tdValue">
													<input type="text" name="car.address" id="car.address"
													class="inputtext" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													<span class="required-field">*</span>车辆归属人：
												</td>
												<td class="tdValue">
													<input type="text" name="car.owner" id="car.owner"
														class="inputtext" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													车辆行驶证注册日期：
												</td>
												<td class="tdValue">
													<input type="text" name="car.registrationDate"
													id="car.registrationDate" class="Wdate"
													onClick="WdatePicker({dateFmt:'yyyy-MM-dd'});" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
													车辆行驶证发证日期：
												</td>
												<td class="tdValue">
													<input type="text" name="car.issueDate" id="car.issueDate"
													class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'});" />
												</td>
											</tr>
											<tr>
												<td class="tdLabel" width="100">
												</td>
												<td class="tdValue">
													<!-- <input type="submit" id="submit_button"
													class="default_btn" value="注 册" /> -->
													<div class="button button-mblue">
														<input type="submit" value="注 册" id="button_submit" class="button-text">
													</div>
												</td>
											</tr>
										</tbody>
										</table>
									</div>
									<!-- 车辆基本信息结束 -->
									
									<script type="text/javascript">
									var $driver_select = $("#driver_select");
									var dialog;
									function openDialog()
									{
										$.ajax({
											type : "post",
											url : "car/preAddDriverQuick.action",
											data : {
											},
											dataType : "html",
											success : function(data) {
												
												dialog = new Dialog({type:'html',value:data}, {title:'添加司机信息'}, {fixed:false});
												dialog.show();
											}
										});
										
									}
									</script>
								</form>
							</div>
						</div>
					</div>
				</div>
				<!-- 中间 -->
				<!--右侧-->
				<%-- <div class="realR_right">
					<div class="box mb10">
						<jsp:include page="../noticeTemplate.jsp"></jsp:include>
					</div>
				</div> --%>
				<!--右侧-->
			</div>
			<!--中由-->
		</div>
	</div>
	<div>
		<jsp:include page="../footer.jsp"></jsp:include>
	</div>
</body>
</html>
